package net.zjitc.springboot_mybatisplus.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.zjitc.springboot_mybatisplus.dao.BookDao;
import net.zjitc.springboot_mybatisplus.domain.Book;
import net.zjitc.springboot_mybatisplus.service.BookService;
import org.springframework.stereotype.Service;

@Service
public class BookServiceImpl extends ServiceImpl<BookDao, Book> implements BookService {
    @Override
    public void updateBook() {
        QueryWrapper<Book> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type", "math");
        Book book = new Book();
        book.setType("science");

        this.update(book, queryWrapper);
    }
}
